﻿namespace Resharper.Abstractions.CodeDom.Namespaces
{
  using JetBrains.Annotations;
  using JetBrains.ReSharper.Psi.Tree;
  using Resharper.Abstractions.CodeDom.TreeNodes;

  /// <summary>Defines the <see cref="Namespace"/> class.</summary>
  public class Namespace : TreeNode
  {
    #region Constructors and Destructors

    /// <summary>Initializes a new instance of the <see cref="Namespace"/> class.</summary>
    /// <param name="namespace">The @namespace.</param>
    internal Namespace([NotNull] INamespaceDeclaration @namespace) : base(@namespace)
    {
    }

    #endregion

    #region Properties

    /// <summary>
    /// Gets the full name.
    /// </summary>
    [NotNull]
    public string FullName
    {
      get
      {
        var internalNamespace = this.InternalNamespace;

        return internalNamespace.QualifiedName ?? string.Empty;
      }
    }

    /// <summary>The @namespace field.</summary>
    [NotNull]
    internal INamespaceDeclaration InternalNamespace
    {
      get
      {
        return (INamespaceDeclaration)this.InternalTreeNode;
      }
    }

    #endregion
  }
}